#ifndef _PLUGINITEM_H_
#define _PLUGINITEM_H_

#include "stdafx.h"

class CPlugins
{
public:
    CPlugins(void);
    ~CPlugins(void);

public:
    HRESULT Clear();
    HRESULT LoadMemory(LPCSTR buf, ULONG len);
    DWORD GetClsidCount();
    DWORD GetCompentsCount();
    const ComponentPlugin& LoadCompents();
    DWORD LoadClsidAll(PluginVector& vecPlugins);
    DWORD LoadClsid(PluginVector& vecPlugins, const char* pComponents);

private:
    JsonSafePtr m_pJson;
    CharArrayPtr m_pdata;
    PluginVector m_SortVecPlugins;
    ComponentPlugin m_mapComponents;

private:
    HRESULT LoadPluginModule(sjsoncptr JsRoot);
    HRESULT LoadPluginItem(sjsoncptr JsRoot);
    HRESULT GetItemString(sjsoncptr JsRoot, const char* id, char** pItem);
};

#endif
